<template>
	<view class="news-content">
		<view class="banner">
			<view class="banner-title">{{title}}</view>
		</view>
		<view class="article-meta">
			<text class="article-text">发表于</text>
			<text class="article-time" >{{datetime}}</text>
		</view>
		<view class="article-content">
			<rich-text :nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: '',
				title:'',
				datetime:''
			}
		},
		onLoad(param) {
			let data = JSON.parse(param.current)
		
			this.viewContext(data);
		},
		methods: {

			viewContext: function(data) {
				var self = this;
				
				this.$request('S1022', {ID:data.ID}, 'POST', function(res) {
					if (res.data.CODE == 0) {
						self.content = res.data.DATA.NEWSCONTENT;
						self.title = data.HEADLINE;
						self.datetime = data.PUBDATE;
					} else {
						self.$common.errorToShow(res.data.MSG);
					}

				})
			}
		}
	}
</script>

<style lang="scss">
	.news-content{
		padding:40upx 30upx 20upx;
		.banner{
			padding-bottom:20upx;
			font-size: 25px;
			line-height: 34px;
			font-weight: 700;
			text-align: justify;
			color:#303133;
		}
		.article-meta{
			display: flex;
			justify-content: space-between;
			font-size: 16px;
			line-height: 60upx;
			.article-text{
				color: #0BA809;
			}
			.article-time{
				color: #909399;
			}
		}
		.article-content{
			line-height: 50upx;
			color:#606266;
		}
	}
	
</style>
